import request from '@/utils/request'


export function getHapproveList(params = {}) {
    return request({
        url: "/getHapproveList",
        method: "get",
        params
    })
}

/**
 * 
 * @param {id} params 货主id 
 * @returns 
 */
export function getHapproveDetail(params = {}) {
    return request({
        url: "/getHapproveDetail",
        method: 'get',
        params
    })
}
/**
 * 审核货主
 * @param {一大堆} data 
 * @returns 
 */
export function reviewShipper(data = {}) {
    return request({
        url: "/reviewShipper",
        method: 'post',
        data
    })
}

/**
 * 获取司机列表
 * @param {} params 
 * @returns 
 */
export function getDriverList(params = {}) {
    return request({
        url: "/getDriverList",
        method: 'get',
        params
    })
}
/**
 * 
 * @param {id} params 司机id 
 * @returns 
 */
export function getDriverDetail(params = {}) {
    return request({
        url: "/getDriverDetail",
        method: 'get',
        params
    })
}
/**
 * 司机审核
 * @param 一大堆参数 {*} data 
 * @returns 
 */
export function driverReview(data = {}) {
    return request({
        url: "/driverReview",
        method: 'post',
        data
    })
}
/**
 * 司机退回
 * @param  {*}  id
 * @returns 
 */
export function returnBack(data = {}) {
    return request({
        url: '/returnBack',
        method: 'post',
        data,
    })
}

/**
 * 修改司机手机号
 * @param {user_id,mobile} data 
 * @returns 
 */
export function updateDriverCar(data = {}) {
    return request({
        url: "/updateDriverCar",
        method: "post",
        data
    })
}

//上传货主
export function uploadPerson(data = {}) {
    return request({
        url: "/uploadPerson",
        method: "post",
        data
    })
}

/**
 * 保存货主信息
 * @param {id,area,is_test,shxydm,company_name} data 
 * @returns 
 */
export function saveHapprove(data = {}) {
    return request({
        url: "/saveHapprove",
        method: "post",
        data
    })
}


/**
 * 设置税率
 * @param {id,tax} data 
 * @returns 
 */
export function setTax(data = {}) {
    return request({
        url: "/setTax",
        method: 'post',
        data
    })
}

/**
 * 修改货主是否可以支付
 * @param {*} data 
 * @returns 
 */
export function updatePayStatus(data = {}) {
    return request({
        url: "/updatePayStatus",
        method: 'post',
        data
    })
}

/**
 * 修改货主状态
 * @param id 自增id 
 * @param type 0正常1暂停 
 * @returns 
 */
export function setPauseOwner(data = {}) {
    return request({
        url: "/setPauseOwner",
        method: 'post',
        data
    })
}


/**
 * 根据经纬度数组获取对应的详细地址信息
 * @param array
 * @returns 
 */
export function carPositionAddress(data = {}) {
    return request({
        url: "https://api.zhgylgl.com/api/shipper/carPositionAddress",
        method: 'post',
        data,
    })
}
